#!/bin/bash

# ----------------------------------------------------------------------
# Filename:   75583-lscpu-V.sh
# Version:    1.0
# Date:       2013/12/03
# Author:     yuanhui.shi
# Email:      yuanhui.shi@cs2c.com.cn
# Summary:    02系统基本功能-07开发环境-02开发工具-08lscpu-01lscpu显示版本信息
# Notes:      lscpu命令
# Copyright:  China Standard Software Co., Ltd.
# History：     
#             Version 1.0, 2013/12/03
#             -   The first one
# ----------------------------------------------------------------------

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

source ../../lib/Echo.sh

source ../../lib/XmlParse.sh


function CleanData ()
{
  EchoInfo "75583-lscpu-V.sh执行完毕"
}

trap "CleanData" EXIT INT

LSCPU_VERSION=$(rpm -qf `which lscpu` | awk -F "-" '{printf "%s-%s %s",$1,$2,$3}')

echo ${LSCPU_VERSION} | grep '[0-9]'
if [ $? -ne 0 ];then
    LSCPU_VERSION=$(rpm -qf `which lscpu` | awk -F "-" '{printf "%s-%s-%s %s",$1,$2,$3,$4}')
fi


[ "`LANG=C lscpu -V`" == "lscpu from ${LSCPU_VERSION}" ]
EchoResult "lscpu显示版本信息正确"
